# 列表处理

xlist=[]
average = 0
for i in range(3):
    xlist.append([])
    for j in range(3):
        x=eval(input(""))
        xlist[i].append(x)
        average += x
average /= 9
#代码开始
ylist = []
for i in range(3):
    ylist.append([])
    for j in range(3):
        if xlist[i][j] > average:
            ylist[i].append(1)
        else:
            ylist[i].append(0)
#代码结束
for i in range(3):
    for j in range(3):
        print(ylist[i][j],end="")
    print()